using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UI_EquipmentSlotParent : MonoBehaviour
{
    private UI_EquipmentSlot[] equipmentSlots;

    public void UpdateEquipmentSlot(List<Inventory_EquipmentSlot> equipments)
    {
        equipmentSlots = GetComponentsInChildren<UI_EquipmentSlot>();

        for (int i = 0; i < equipmentSlots.Length; i++)
        {
            if (equipments[i] == null)
                continue;
            Inventory_EquipmentSlot equipment = equipments[i];
            if (equipment.HasPlugSlot() == false)
                equipmentSlots[i].UpdateItemSlot(null);
            else
                equipmentSlots[i].UpdateItemSlot(equipment.equipedItem);
        }
    }
}
